<template>
	<view class="big-cart">
		<view class="cart-item" v-for="(item,i) in bigCartList" :key="i"
			@tap="$Router.push({path: '/pages/goods/goods_detail', query: {from: fromType}})">
			<image class="img" :src="item.goods_img" mode="widthFix"></image>
			<view class="msg-content">
				<view class="title-name">{{item.name}}</view>
				<view class="price-all">
					<view class="price-num" v-if="comptype=='jifen'">{{ item.jifen }}积分</view>
					<view class="price-num" v-else>￥{{item.price}}</view>
					<view class="ok-num">已售{{item.goods_ok}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "t-big-cart",
		props: {
			comptype: {
				String,
				default: ''
			},
			bigCartList: {
				type: Array,
				default: []
			},
			fromType: {
				type: String,
				default: 'menu'
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.big-cart {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		.cart-item {
			border-radius: 5rpx;
			border: solid 1rpx #e5e5e5;
			width: 348rpx;
			margin-bottom: 30rpx;
			background-color: #ffffff;

			.img {
				width: 349rpx;
				// height: 404rpx;
				background-color: #ffffff;
			}

			.msg-content {
				.title-name {
					width: 320rpx;
					margin-left: 20rpx;
					margin-top: 19rpx;
					font-size: 28rpx;
					letter-spacing: 3rpx;
					color: #363636;
					//超出一行省略号
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
				}

				.price-all {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin: 20rpx;

					.price-num {
						font-size: 28rpx;
						letter-spacing: 3rpx;
						color: #d81e06;
					}

					.ok-num {
						font-size: 20rpx;
						letter-spacing: 2rpx;
						color: #989898;
					}
				}
			}
		}
	}
</style>
